<?php

namespace App\Modules\Apicrzs\Http\Controllers\Buy;

use App\Modules\Apicrzs\Http\Controllers\BaseApicrzsController;
use App\Modules\Apicrzs\Services\Users\UserExtractServices;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class UserExtractController extends BaseApicrzsController
{
    public function __construct(UserExtractServices $service)
    {
        $this->service = $service;
    }
    public function extractList(Request $request): JsonResponse
    {
        $params = $request->all();
        $result = $this->service->getUserExtractList($params);

        return $this->sendApiSuccess($result, $this->service->getError());
    }
    public function cashCreate(Request $request): JsonResponse
    {
        $params = $request->all();
        $result = $this->service->cashCreate($params);
        if ($result){
            return $this->sendApiSuccess($result, $this->service->getError());
        }else{
            return $this->sendApiError($this->service->getError(),50002);
        }
    }



}
